package edu.cuit.zhuyimeng.framework.common.config;

import cn.dev33.satoken.stp.StpLogic;
import edu.cuit.zhuyimeng.framework.common.interceptor.TokenRequestInterceptor;
import edu.cuit.zhuyimeng.framework.common.interceptor.TokenResponseInterceptor;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Bean;

@AutoConfiguration
@ConditionalOnClass({StpLogic.class, FeignClient.class})
public class SecurityAutoConfiguration {

    @Bean
    public TokenResponseInterceptor feignResponseInterceptor() {
        return new TokenResponseInterceptor();
    }

    @Bean
    public TokenRequestInterceptor feignRequestInterceptor() {
        return new TokenRequestInterceptor();
    }


}
